lib/pull: Tweak update_timeout logic again
authorJonathan Lebon <jonathan@jlebon.com>
Mon, 28 Oct 2019 18:04:55 +0000 (14:04 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Mon, 28 Oct 2019 19:26:45 +0000 (15:26 -0400)
commit74936f98d89514820c4d1ec574269fd0a140f1da
treec1a7697bc8b4c40e8793e65c1b39a1b76981c2e4
parentbd3f24e6c36ec8bed67e2bc65388e5be6853c48d
lib/pull: Tweak update_timeout logic again

I was hitting `SIGSEGV` when running `cosa build` and narrowed it down
to #1954. What's happening here is that because we're using the default
context, when we unref it in the out path, it may not actually destroy
the `GSource` if it (the context) is still ref'ed elsewhere. So then,
we'd still get events from it if subsequent operations iterated the
context.

This patch is mostly a revert of #1954, except that we still keep a ref
on the `GSource`. That way it is always safe to destroy it afterwards.
(And I've also added a comment to explain this better.)
src/libostree/ostree-repo-pull.c